#ifndef _LED_H_
#define _LED_H_

#include "Global.h"

#pragma pack(1)
typedef struct 
{
    uint8 Buf;
    uint16 Tm;
    uint16 TmOn;
    uint16 TmPeriod;
    uint8 Loop;
}Typedef_LED;
#pragma pack()

#define P_LED0      &PORT->P0,(1<<2)
#define P_LED1      &PORT->P0,(1<<0)
#define P_LED2      &PORT->P2,(1<<0)
#define P_LED3      &PORT->P3,(1<<5)
#define P_LED4      &PORT->P3,(1<<2)

#define LED_ALL_OFF     0x00
#define LED_D3_ON       0x04
#define LED_TYPE_3      3

enum
{
    LED1 = 0x01,
    LED2 = 0x02,
    LED3 = 0x04,
    LED4 = 0x08,
    LED5 = 0x10,
};

#define LED_SEND        LED5
#define TIME_BASE_LED   8
#define TM_LED_SHORT    (200/TIME_BASE_LED)
#define TM_LED_MODE     (1000/TIME_BASE_LED)
#define TM_LED_LONG     (5000/TIME_BASE_LED)
#define TM_LED_POWER_ON (1000/TIME_BASE_LED)


void    initLED(void);
void    SetLed(uint8 led_buf,uint16 time_on,uint16 time_period,uint8 loop);
void    Led_Main(void);
#endif
